<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<script type="text/javascript">
	function showMsg($item, msgType, msg, timeout){
		var classType='ui-state-highlight';
		if(msgType=='error'){
			classType='ui-state-error';
		}
		$item.addClass(classType);
		$item.html("<span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span>"+msg);
		setTimeout(function(){$item.html('').removeClass(classType);},timeout);
	}
	function query(){
		var key=jQuery.trim($('#key').val());
		if(key.length==0){
			showMsg($('#searchTips'),'error','请输入电话搜索关键字，例如：中国移动',5000);
			return;
		}
		window.location.href="<c:url value='/search?'/>key="+encodeURIComponent(key);
	}
	function enterKey(){
		if(event.keyCode==13){query();}
	}
	$(function(){
		$('#key').focus();
		$('#go').click(function(){query();});
	});
	</script>
<div id="index">
<table>
	<tr>
		<td colspan="2">
		<div id="search"><input id="key" name="key"
			onkeydown="javascript:enterKey();" />
		<button id="go" value="搜索电话">搜索电话</button>
		<div id="searchTips"></div>
		</div>
		</td>
	</tr>
	<tr>
		<td>
		<div id="left" class="top-border xcenter">
		<p class="title">OTO-Phone电话分享流程</p>
		<img class="oto-flows"
			src="<c:url value="/images/oto-sharing-flows.png"/>" /></div>
		</td>
		<td>
		<div id="right">
		<div class="top-border" style="min-height: 200px;">
		<p class="title">最新加入的用户</p>
		<ul>
			<c:forEach var="e" items="${it.lattestUsers}">
				<li>${e.name}</li>
			</c:forEach>
		</ul>
		</div>
		<div class="top-border" style="min-height: 200px;">
		<p class="title">最新分享的电话<a href="<c:url value="/public"/>">更多</a></p>
		<ul>
			<c:forEach var="e" items="${it.lattestFlows}">
				<li>${e.name}</li>
			</c:forEach>
		</ul>
		</div>
		</div>
		</td>
	</tr>
</table>
</div>